#pragma once
#include "vn/Convert.h"

void ConvertTestUnicode() {_test_func_;
	{_block_("ToString: 20 times");
		assert( Convert::ToString((Int  )-1234)	== "-1234");
		assert( Convert::ToString((Int64)-1234) == "-1234");
		assert( Convert::ToString((Long)-1234) == "-1234");
		assert( Convert::ToString((Short)-1234) == "-1234");
		/*
		assert( Convert::ToString((Char)-123 )	== "-123");
		*/

		assert( Convert::ToString((UInt  )1234)	== "1234");
		assert( Convert::ToString((UInt64)1234)	== "1234");
		assert( Convert::ToString((ULong)1234)	== "1234");
		assert( Convert::ToString((UShort)1234)	== "1234");
		assert( Convert::ToString((UChar )'w' )	== "w");

		assert( Convert::ToString((double)-12.34)	== "-12.34");
		assert( Convert::ToString((float )-12.5)	== "-12.5");
		assert( Convert::ToString((char  )'a')		==  "a");
#ifdef _UNICODE
		assert( Convert::ToString((WChar )L'ờ')		== L"ờ");
		assert( Convert::ToString((LPCWChar	)L"cộng hòa")	== L"cộng hòa");
#endif
		assert( Convert::ToString((LPCChar	) "cong hoa")	==  "cong hoa");

		assert( Convert::ToString(String("string"))  == "string");
		assert( Convert::ToString(StringA("string")) == "string");
		assert( Convert::ToString(StringW("string")) == "string");

		assert( Convert::ToString(true ) == "true");
		assert( Convert::ToString(false) == "false");
	}
}

void ConvertTest() {_test_func_;
	{_block_("ToString: 20 times");
		assert( Convert::ToString((Int  )-1234)	== "-1234");
		assert( Convert::ToString((Int64)-1234) == "-1234");
		assert( Convert::ToString((Long)-1234) == "-1234");
		assert( Convert::ToString((Short)-1234) == "-1234");
		/*
		assert( Convert::ToString((Char)-123 )	== "-123");
		*/

		assert( Convert::ToString((UInt  )1234)	== "1234");
		assert( Convert::ToString((UInt64)1234)	== "1234");
		assert( Convert::ToString((ULong)1234)	== "1234");
		assert( Convert::ToString((UShort)1234)	== "1234");
		assert( Convert::ToString((UChar )'w' )	== "w");

		assert( Convert::ToString((double)-12.34)	== "-12.34");
		assert( Convert::ToString((float )-12.5)	== "-12.5");
		assert( Convert::ToString((char  )'a')		==  "a");

		assert( Convert::ToString((WChar )L'o')		== L"o");
		assert( Convert::ToString((LPCWChar	)L"cong hoa")	== L"cong hoa");

		assert( Convert::ToString((LPCChar	) "cong hoa")	==  "cong hoa");

		assert( Convert::ToString(String("string"))  == "string");
		assert( Convert::ToString(StringA("string")) == "string");
		assert( Convert::ToString(StringW("string")) == "string");

		assert( Convert::ToString(true ) == "true");
		assert( Convert::ToString(false) == "false");
	}
}
